From 51f98b6a707552b29ccdf3134b4da7eb2c5e2aa3 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Mon, 8 Sep 2003 19:51:16 +0000 Subject: [PATCH] Fixes from David Hampton via gtk-devel-list. Mon Sep 8 21:44:20 2003 Kristian Rietveld Fixes from David Hampton via gtk-devel-list. * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix the call to gtk_tree_model_filter_add_root, (gtk_tree_model_filter_row_changed): bail out if c_path is not above the virtual root, allow building levels on the second try to convert the child path to a filter path, (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual root when calling gtk_tree_model_filter_elt_get_path. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-4 | 12 ++++++++++++ ChangeLog.pre-2-6 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtktreemodelfilter.c | 14 +++++++++----- 6 files changed, 69 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 318b16d878..8be5ebc5f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Mon Sep 8 21:44:20 2003 Kristian Rietveld + + Fixes from David Hampton via gtk-devel-list. + + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix + the call to gtk_tree_model_filter_add_root, + (gtk_tree_model_filter_row_changed): bail out if c_path is not above + the virtual root, allow building levels on the second try to convert + the child path to a filter path, + (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual + root when calling gtk_tree_model_filter_elt_get_path. + 2003-09-07 Matthias Clasen * gtk/gtkuimanager.c (update_node): Fix a C99ism. (#121640, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 318b16d878..8be5ebc5f4 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Mon Sep 8 21:44:20 2003 Kristian Rietveld + + Fixes from David Hampton via gtk-devel-list. + + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix + the call to gtk_tree_model_filter_add_root, + (gtk_tree_model_filter_row_changed): bail out if c_path is not above + the virtual root, allow building levels on the second try to convert + the child path to a filter path, + (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual + root when calling gtk_tree_model_filter_elt_get_path. + 2003-09-07 Matthias Clasen * gtk/gtkuimanager.c (update_node): Fix a C99ism. (#121640, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 318b16d878..8be5ebc5f4 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +Mon Sep 8 21:44:20 2003 Kristian Rietveld + + Fixes from David Hampton via gtk-devel-list. + + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix + the call to gtk_tree_model_filter_add_root, + (gtk_tree_model_filter_row_changed): bail out if c_path is not above + the virtual root, allow building levels on the second try to convert + the child path to a filter path, + (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual + root when calling gtk_tree_model_filter_elt_get_path. + 2003-09-07 Matthias Clasen * gtk/gtkuimanager.c (update_node): Fix a C99ism. (#121640, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 318b16d878..8be5ebc5f4 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Mon Sep 8 21:44:20 2003 Kristian Rietveld + + Fixes from David Hampton via gtk-devel-list. + + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix + the call to gtk_tree_model_filter_add_root, + (gtk_tree_model_filter_row_changed): bail out if c_path is not above + the virtual root, allow building levels on the second try to convert + the child path to a filter path, + (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual + root when calling gtk_tree_model_filter_elt_get_path. + 2003-09-07 Matthias Clasen * gtk/gtkuimanager.c (update_node): Fix a C99ism. (#121640, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 318b16d878..8be5ebc5f4 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Mon Sep 8 21:44:20 2003 Kristian Rietveld + + Fixes from David Hampton via gtk-devel-list. + + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_elt_get_path): fix + the call to gtk_tree_model_filter_add_root, + (gtk_tree_model_filter_row_changed): bail out if c_path is not above + the virtual root, allow building levels on the second try to convert + the child path to a filter path, + (gtk_tree_model_filter_convert_iter_to_child_iter): pass the virtual + root when calling gtk_tree_model_filter_elt_get_path. + 2003-09-07 Matthias Clasen * gtk/gtkuimanager.c (update_node): Fix a C99ism. (#121640, diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c index 3e5d52ce86..e5be15d23d 100644 --- a/gtk/gtktreemodelfilter.c +++ b/gtk/gtktreemodelfilter.c @@ -584,9 +584,7 @@ gtk_tree_model_filter_elt_get_path (FilterLevel *level, if (root) { - real_path = gtk_tree_path_copy (root); - - gtk_tree_model_filter_add_root (real_path, path); + real_path = gtk_tree_model_filter_add_root (path, root); gtk_tree_path_free (path); return real_path; } @@ -1019,6 +1017,12 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model, else gtk_tree_model_get_iter (c_model, &real_c_iter, c_path); + /* is this node above the virtual root? */ + if (filter->priv->virtual_root + && (gtk_tree_path_get_depth (filter->priv->virtual_root) + >= gtk_tree_path_get_depth (c_path))) + goto done; + /* what's the requested state? */ requested_state = gtk_tree_model_filter_visible (filter, &real_c_iter); @@ -1096,7 +1100,7 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model, if (!path) path = gtk_real_tree_model_filter_convert_child_path_to_path (filter, c_path, - FALSE, + TRUE, TRUE); g_return_if_fail (path != NULL); @@ -2505,7 +2509,7 @@ gtk_tree_model_filter_convert_iter_to_child_iter (GtkTreeModelFilter *filter, path = gtk_tree_model_filter_elt_get_path (filter_iter->user_data, filter_iter->user_data2, - NULL); + filter->priv->virtual_root); gtk_tree_model_get_iter (filter->priv->child_model, child_iter, path); gtk_tree_path_free (path); } -- 2.30.2